<?php

class Content_Page_Main_View extends Content_Page_Main {

	protected function __construct($args){
		$this->content = Content::GetByID($args['id']);
		parent::__construct($args);
	}

	public function rid($array = array()){
		return parent::rid(array_merge(
			array($this->content->id(), 'view'),
			$array
		));
	}

	public static function Load($args){
		$page = new Content_Page_Main_View($args);
		return $page;
	}

	public function run(){
		parent::run();
	}

	public function output($child = null){
		$template = Output::getInstance()->Template(array('content','page','view'));
		$template->title = $this->content->title();
		$template->body = $this->content->body();
		return parent::output($template);
	}

}
